package com.kinoshita.admin.controller.api;

import com.kinoshita.admin.api.client.AdminClient;
import com.kinoshita.admin.service.IAdminService;
import com.kinoshita.common.result.ResultDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/admin-api")
public class AdminAPI {

    @Autowired
    private IAdminService adminService;

    @PostMapping("/getAdminByName")
    public @ResponseBody ResultDO getAdminByName(@RequestBody String username) {
        return adminService.getAdminByName(username);
    }
}
